#ifndef SDO_H
#define SDO_H
#include "stm32F4xx.h"
#include "Node.h"


/***********User Define Begin ***************/

#define 	SDO_OUTTIME_SET     			9000
#define 	SDO_ERRORTIME_SET     			9000

#define 	BYTE_0		0
#define 	BYTE_1		1
#define 	BYTE_2		2
#define 	BYTE_3		3
#define 	BYTE_4		4

#define 	SUBINDEX_0 	0
#define 	SUBINDEX_1 	1
#define 	SUBINDEX_2 	2
#define 	SUBINDEX_3 	3
#define 	SUBINDEX_4 	4


/************User Define End *****************/


/***************User-defined Variable Type Begin ********************/

enum 
{
	SDO_MESSAGE_W,
	SDO_MESSAGE_R
};




/***************User-defined Variable Type End ********************/


/*****************User Function Void Begin***************/

void SDO_Tx(CANopen_Node_t *node, uint8_t wor, uint16_t index, uint8_t subIndex, uint8_t dataLen, uint32_t data);
void SDOResponse(CANopen_Node_t *node, uint8_t *CANrecvData);

void SDO_WorkStateMachine(CANopen_Node_t *node);

void SDO_NodeClassify(CANopen_Node_t *node , uint32_t SDO_id , uint8_t *motodata_fb);

void SDO_WaitResponse_WatchDog(uint16_t SDO_outTime_Count);
void SDO_ErrorState_WatchDog(uint16_t SDO_errorTime_Count);
/*****************User Function Void End***************/


#endif


